#ifndef __PUBLIC_H__
#define __PUBLIC_H__

#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <set>
#include <map>
#include <string>
#include <memory>
#include <mutex>
#include "rtxpSession.h"

using namespace std;
#define MAXCONN 65535

class IoEvents
{
public:
	IoEvents();
	int protocol; // 0:timer 1: rtsp 2:rtp 3:rtcp
	BaseSession *session_handler;
	int init_events(int fd, char *ip, int type, BaseSession *handler);

private:
	int set_nonblock(int fd);
};

extern IoEvents *events[MAXCONN];
#endif
